package model

import (
	"manager/model/entity"
)

// VoiceSeriesCreateRequest 创建现场数据
type VoiceSeriesCreateRequest struct {
	Name string `json:"name"`

	Type int `json:"type"`

	UpdatedAt int64 `json:"updated_at"`
}

// VoiceSeriesUpdateRequest 更新现场数据
type VoiceSeriesUpdateRequest struct {
	Id int64 `json:"id"`

	Name *string `json:"name"`

	Type *int `json:"type"`

	CreatedAt int64 `json:"created_at"`

	UpdatedAt *int64 `json:"updated_at"`
}

// VoiceSeriesListRequest 列表现场数据
type VoiceSeriesListRequest struct {
	Index int `json:"index"`
	Size  int `json:"size"`

	Id int64 `json:"id"`

	Name *string `json:"name"`

	Type *int `json:"type"`

	UpdatedAt *int64 `json:"updated_at"`
}

// VoiceSeriesListResponse 列表回包数据
type VoiceSeriesListResponse struct {
	Total int                `json:"total"`
	List  []*VoiceSeriesInfo `json:"list"`
}

// VoiceSeriesInfoRequest 列表现场数据
type VoiceSeriesInfoRequest struct {
	Id int64 `json:"id"`

	Name *string `json:"name"`

	Type *int `json:"type"`

	UpdatedAt *int64 `json:"updated_at"`
}

// VoiceSeriesInfo 详细数据
type VoiceSeriesInfo struct {
	Id int64 `json:"id"`

	Name string `json:"name"`

	Type int `json:"type"`

	CreatedAt int64 `json:"created_at"`

	UpdatedAt int64 `json:"updated_at"`
}

// VoiceSeriesDeleteRequest 删除现场数据
type VoiceSeriesDeleteRequest struct {
	Id int64 `json:"id"`
}

// VoiceSeriessEntityToDto entity数据转换
func VoiceSeriessEntityToDto(voiceSeriess []*entity.VoiceSeries) []*VoiceSeriesInfo {
	out := make([]*VoiceSeriesInfo, 0, len(voiceSeriess))
	for _, c := range voiceSeriess {
		out = append(out, VoiceSeriesEntityToDto(c))
	}
	return out
}

// VoiceSeriesEntityToDto entity数据转换
func VoiceSeriesEntityToDto(e *entity.VoiceSeries) *VoiceSeriesInfo {
	return &VoiceSeriesInfo{

		Id: e.Id,

		Name: e.Name,

		Type: e.Type,

		CreatedAt: e.CreatedAt,

		UpdatedAt: e.UpdatedAt,
	}
}
